<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../Template/AdminTemplate.xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui">

    <ui:define name="content">
        
            <h:form id="form">
                <p:panel id="panel" header="Create New Prize ">
                    <p:messages id="msgs"/>
                <h:panelGrid columns="2">
                    
                    <h:outputLabel value="PrizeId:" for="prizeId" />
                    <p:inputText  value="#{prizeControl.prize.prizeId}" title="input PrizeId" required="true" requiredMessage="The EventId field is required ">
                        
                    </p:inputText>
                    
                    <h:outputLabel value="Title of Event:" for="eventId"  />
                    <p:selectOneMenu id="eventId" value="#{prizeControl.prize.eventId}"  required="true" requiredMessage="The EventId field is required.">
                                <!-- TODO: update below reference to list of available items-->
                                <f:selectItems value="#{prizeControl.eventList}"/>
                    </p:selectOneMenu>
                    <h:outputLabel value="Title:" for="title" />
                    <p:inputTextarea rows="3" cols="33" value="#{prizeControl.prize.title}" title="input title" required="true" requiredMessage="The Title is required">
                        
                    </p:inputTextarea>
                      
                        
                    <h:outputLabel value="PrizeDate:" for="prizeDate" />
                    <p:calendar value="#{prizeControl.prize.prizeDate}"  showButtonPanel="true" required="true" requiredMessage="The PrizedDay is required."/>
                    
                    <h:outputLabel value="Description:" for="description" />
                    <p:editor value="#{prizeControl.prize.description}"/>
                    <p:commandButton value="Create" actionListener="#{prizeControl.insert()}" update="panel"/>
                    
            </h:panelGrid>
            </p:panel>
        </h:form>
        
    </ui:define>

</ui:composition>
